//
//  DetailGroupTitleView.swift
//  KoiAccounting
//
//  Created by 纪洪文 on 22.03.25.
//

import SwiftUI

struct DetailGroupTitleView: View {
    
    @Binding var item:AccountingDetailRowGroup
    var body: some View {
        HStack {
            Text(item.date)
                .font(.system(size: 12))
                .fontWeight(.semibold)
                .foregroundColor(Color.koiColorTitleSecond)
            Spacer()
            Text(item.getExpenseAndIncome())
                .font(.system(size: 12))
                .foregroundColor(Color.koiColorTitleSecond)
        }.padding(EdgeInsets(top: 0, leading: 5, bottom: 0, trailing: 5))
    }
}

@available(iOS 18.0, *)
#Preview {
    @Previewable @State var item = AccountingDetailRowGroup(id: 1, date: "2025-03-22",dateOriginal: "2025-03-22", expenseAmount: 0,incomeAmount: 0,  groupData: [AccountingDetailCombine.previewData()])
    DetailGroupTitleView(item: $item)
}
